<template>
    <div class="default-table-detail-container">
        <BaseTableInfo v-model="baseTableInfoModel" />
    </div>
</template>

<script lang="ts" setup>

import CompanyInfoNoticeApi from '/@/api/webPath/CompanyInfoNoticeApi.ts';

const props = defineProps({
    modelValue: {

    }
})
const route = useRouter()

const baseTableInfoModel = ref({
    columnCount: 3,
    autoFit: false,
    columnWidth: '300px',
    labelWidth: '100px',
    title: '基本信息',
    modelData: {},
    itemList: [
        {
            title: '',
            items: [   //渲染样式区域  通过key ===model 中的值
                {
                    label: "id",
                    field: "id",
                },
                {
                    label: "公告名称",
                    field: "noticeName",
                },
                {
                    label: "公告内容",
                    field: "noticeContent",
                },
                {
                    label: "公告附件",
                    field: "noticeFile",
                },
                {
                    label: "公告类型",
                    field: "noticeType",
                },
                {
                    label: "发布时间",
                    field: "releaseTime",
                },
                {
                    label: "模板来源：console，company",
                    field: "sourceType",
                },
                {
                    label: "所属公司",
                    field: "companyId",
                },
                {
                    label: "发布人",
                    field: "creator",
                },
                {
                    label: "修改人",
                    field: "reviser",
                },
                {
                    label: "排序",
                    field: "sort",
                },
                {
                    label: "创建时间",
                    field: "create_time",
                },
                {
                    label: "更新时间",
                    field: "update_time",
                },
            ]
        }
    ],
    buttons: [   //标题操作区域
        // {
        //   name: "更多",
        //  buttonClass: 'danger',
        // width: 100,
        // click: (any: object) => {   //暴露的方法钩子
        // $baseMessage("这里执行业务", 'success', 'vab-hey-message-success');
        //},
        //},


    ]
})

onMounted(async () => {
    //初始化数据model
    const { data } = await CompanyInfoNoticeApi.getDetail({
        companyInfoNoticeId: props.modelValue.query.companyInfoNoticeId   //从路由中获取参数
    })
    baseTableInfoModel.value.modelData = data;





})
</script>

<style lang="scss" scoped>
.default-table-detail-container {
    :deep() {
        .el-form--inline {
            .el-form-item {
                margin-right: 10px;
            }
        }

        .el-descriptions__label {
            min-width: 80px !important;
            text-align: right;
        }
    }
}
</style>
